package com.baizhi.cmfzmanager.service.impl;

import com.baizhi.cmfzmanager.dao.LogDao;
import com.baizhi.cmfzmanager.entity.Log;
import com.baizhi.cmfzmanager.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private LogDao logDao;

    @Override
    public Map getLogs(int page, int rows) {
        int start = (page-1)*rows;
        List<Log> logs = logDao.getLogs(start, rows);
        int count = logDao.getCount();
        Map map = new HashMap();
        map.put("rows",logs);
        map.put("total",count);
        return map;
    }

    @Override
    public void delete(int[] ids) {
        logDao.delete(ids);
    }
}
